package com.study.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.study.dao.entity.MovieUser;

@FeignClient("sunxj-microservice-provider-user")
public interface UserFeignClient {
	
	/**
	 * 参数绑定两个坑：
	 * 1、不支持GetMapping
	 * 2、在定义各参数绑定时，@PathVariable()、@RequestParam、@RequestHeader等可以指定参数名称的注解，它们的value不能少。
	 * 
	 * 
	 * 注：@RequestMapping(value="/simple/{id}", method = RequestMethod.GET)
	 *    该注解要与被调用方法的注解一样
	 */
	@RequestMapping(value="/simple/{id}", method = RequestMethod.GET)
	public MovieUser selectById(@PathVariable("id") int id);

	@RequestMapping(value="/postUser", method = RequestMethod.POST)
	public MovieUser postUser(@RequestBody MovieUser user);
	
}
